<?php
defined('IN_PHPCMS') or exit('Access Denied');
include admin_tpl('header');
?>
<script type="text/javascript" src="images/js/form.js"></script>
<script type="text/javascript" src="images/js/jqModal.js"></script>
<script type="text/javascript" src="images/js/jqDnR.js"></script>
<script type="text/javascript" src="/js/func.js"></script>
<body>
<?=$menu?>
<form id="myform" action="?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&catid=<?=$catid?>&modelid=<?=$modelid?>" method="post" name="myform" enctype="multipart/form-data">
<table cellpadding="0" cellspacing="1" class="table_form">
  <caption>发布信息</caption>
 <?php
 foreach($forminfos as $field=>$info)
 {
 ?>
	<tr>
      <th width="20%"><?php if($info['star']){ ?> <font color="red">*</font><?php } ?> <strong><?=$info['name']?></strong> <br />
	  <?=$info['tips']?>
	  </th>
      <td><?=$info['form']?> </td>
    </tr>
<?php
}
?>
	<tr>
      <th width="20%"><strong>状态</strong><br />
	  <?=$info['tips']?>
	  </th>
      <td>
	  <?php if($_roleid[0]<3){ ?>
	  <input type="radio" name="status" value="99" checked/> 发布
	  <?php } ?>
	  <input type="radio" name="status" value="3" <?=$_roleid[0]<3 ? '' : 'checked'?>> 审核
	  <input type="radio" name="status" value="2"> 草稿
	  </td>
    </tr>
    <tr>
      <td></td>
      <td>
	  <input type="hidden" name="forward" value="<?=$forward?>">
	  <input type="submit" name="dosubmit" value=" 确定 ">
      &nbsp; <input type="button" name="preview" value=" 预览 " onClick="preview_content();">
	  &nbsp; <input type="reset" name="reset" value=" 清除 ">
	  </td>
    </tr>
</table>

<div class="jqmWindow">
<h5 class="title" style="cursor:move"><a href="#" class="jqmClose"><img src="images/close.gif" alt="" height="16px" width="16px" /></a>同时发布到其他栏目</h5>
<div id="protocol" style="height:300px;overflow:auto;">
<table cellpadding="0" cellspacing="1" class="table_list">
<caption>请选择栏目</caption>
<?=$categorys?>
<tr>
  <td></td><td><input type="button" value="确定" id="ok" onClick="$('.jqmWindow').hide();" style="width:60px"></td>
</tr>
</table>
</div>
</div>
<input type="hidden" name="fromid" value="<?=$_GET[fromid]?>">
</form>
<div id="contentbox" style="display:none;">
<?//=$cinfo[content]?>
<?=str_replace(">","》》",str_replace("<","《《",$cinfo[content]))?>
<?//=str_replace(">","-#-",str_replace("<","#-#",$cinfo[content]))?>
</div>
<script LANGUAGE="javascript">
setFormValue('info[posids][]','6','formX');
<!--
function preview_content()
{
	myform.action = "preview.php";
	myform.target = "_blank"; 
	myform.submit(); 
	myform.action = "?mod=<?=$mod?>&file=<?=$file?>&action=<?=$action?>&catid=<?=$catid?>&modelid=<?=$modelid?>";
	myform.target="_self";
}
$().ready(function() {
	$('form').checkForm(1);
	$('.jqmWindow').jqm({overlay: 0	}).jqDrag('.title');
	});

//-->
<? if($cinfo!=null){ ?>
setFormValue('status','99','formX');
setFormValue('info[template]','show_lvmao','formX');
setFormValue('info[description]','<?=$cinfo[description]?>','formX');
setFormValue('info[copyfrom]','<?=$cinfo[copyfrom]?>','formX');
setFormValue('info[author]','<?=$cinfo[author]?>','formX');
setFormValue('info[keywords]','<?=$cinfo[keywords]?>','formX');
setFormValue('info[thumb]','<?=$cinfo[thumb]?>','formX');
setFormValue('info[areaid]','<?=$cinfo[areaid]?>','formX');
setFormValue('info[title]','<?=$cinfo[title]?>','formX');
setFormValue('info[titleintact]','<?=$cinfo[titleintact]?>','formX');
var htmlcontent=jQuery('#contentbox').html();
//alert(htmlcontent);
htmlcontent=htmlcontent.replace(/《《/g,'<').replace(/》》/g,'>');
//alert(htmlcontent);
jQuery('#content').val(htmlcontent);
//jQuery('#content').val(jQuery('#contentbox').html());

jQuery('#myform').append('<input value="确定" name="dosubmit">');

setTimeout("gosubmit()",2000);

function gosubmit()
{
	if(jQuery('#content').val()=='')
	{
		alert('要复制的文章html格式有误，请检查后再进行复制');
	}
	else
	{
	myform.submit();
	}
}


<? } ?>

</script>
</body>
</html>